/*
    BibleNotebook - A bible reader software
    Copyright (C) 2014  Williams Fernando Lopez

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
 */

package com.simplebible.bible.objects;

import java.util.List;
import com.simplebible.bible.BibleReader;
import com.simplebible.objects.Preferences;
import wl.util.Utils;

/**
 *
 * @author Williams Lopez
 */
public class ChapterLazy extends Chapter {

    @Override
    public List<Verse> getVerses() {
            if (super.getVerses() == null) {
                try{
                    BibleReader.readChapter(this);
                }catch(Exception e){
                    Utils.printToLog("Error al cargar los versos: "+e.getMessage(), e, Preferences.LOG_LEVEL_ERROR);

                    super.setVerses(null);
                }
            }
            return super.getVerses();
    }

}